/**
 * @copyright Copyright (c) 2023..
 *
 * @file    common_opr_openssl.h
 * @brief   描述 openssl相关API
 * @author  HC(202206728@any3.com)
 * @version 1.0
 * @date    2023-09-27
 */
#ifndef COMMON_OPR_OPENSSL_H
#define COMMON_OPR_OPENSSL_H

#include <string>
#include <iostream>
#include "string.h"

using namespace std;

class CommonOprOpenssl
{
public:
    CommonOprOpenssl();
    ~CommonOprOpenssl();

    static int GetFile_Md5_Hex(const string FilePath, string &MD5_Hex_Out);
    static int GetFile_Md5_Hex_Lower(const string FilePath, string &MD5_Hex_Out);
    static int GetFile_MD5x509_Hex(const string FilePath, string &MD5x509_Hex);
    static int HmacEncode_Hex(const string algo, const string key, const string inputstr, string &outstr);

    static string GetStringSha256HexStr(const string targetstr);

    static string GetCertCharVal_MD5x509_Hex(const string certaddstr);

    static uint8_t BCC(const uint8_t *data, size_t dataLength);
    static string encodeFromArray(const uint8_t *data, size_t len);
};

#endif